cmake_minimum_required(VERSION 3.10.0)
project(slave VERSION 0.1.0)

set(CMAKE_C_STANDARD 99)

# share lib
#add_library(rabbit_utils_lib STATIC
#    common/rabbitmq_utils.c
#    )
# target_include_directories(rabbit_utils_lib
#     PRIVATE
#         ${PROJECT_SOURCE_DIR}/common 
#     )

set(SORUCES
        src/slave.c
        common/config.c
        common/rabbitmq_api.c
        common/msg_queue.c
        common/rabbitmq_utils.c
        )

add_executable(${PROJECT_NAME} ${SORUCES})

target_include_directories(slave
    PRIVATE
        ${PROJECT_SOURCE_DIR}/common 
    )

target_link_libraries(slave 
    -lcjson 
    -lpthread 
    -lrabbitmq 
#    rabbit_utils_lib
    ) 

target_compile_definitions(slave 
    PRIVATE DEBUG
)
